package visitor;

public class Test {
	public static void main(String[] args) {
		try {
			System.out.println("making root entry .....");
			Directory directoryRoot = new Directory("root");
			Directory directoryUsr = new Directory("usr");
			Directory directoryLocal = new Directory("local");
			Directory directoryBin = new Directory("bin");
			Directory directoryTmp = new Directory("tmp");
			directoryRoot.add(directoryUsr);
			directoryRoot.add(directoryLocal);
			directoryRoot.add(directoryBin);
			directoryRoot.add(directoryTmp);
			directoryBin.add(new File("C++", 100));
			directoryBin.add(new File("Java", 200));
			directoryRoot.accept(new ListVisitor());
			
			System.out.println("making usr entry .....");
			Directory yuki = new Directory("yuki");
			Directory tommato = new Directory("tommato");
			Directory hahmah = new Directory("hahmah");
			directoryUsr.add(yuki);
			directoryUsr.add(tommato);
			directoryUsr.add(hahmah);
			yuki.add(new File("C++", 100));
			yuki.add(new File("Java", 200));
			tommato.add(new File("C++", 100));
			tommato.add(new File("Vb", 200));
			hahmah.add(new File("C++", 100));
			directoryUsr.accept(new ListVisitor());
			
			directoryUsr.accept(new FileFindVisitor("Vb"));
			System.out.println("size");
			
			directoryUsr.accept(new SizeVisitor());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
